Silk Mobile

Table of Contents (Homepage)

Landscape & Portrait

Description

You can toggle orientation on the device's reflection by using the key events for Landscape/Portrait.

Note: Android version must be 4.2 or above when using non-instrumented applications.

Usage

Scenario: In the following example We will toggle orientation on an android device to landscape mode by sending the text '{Landscape}'.

Afterwards we will toggle orientation back to portrait by using the key evento of '{Portrait}'.

Step 1: sendText("{LandScape}")

images/download/attachments/3309679/123.png

Step 2: Orientation is now landscape on the real physical device:

images/download/attachments/3309679/2.jpg

Step 3: sendText("{Portrait}")

images/download/attachments/3309679/sentext1.png

Step 4: Rotate the real physical device back to portrait mode:

images/download/attachments/3309679/1.jpg

Advanced configuration:

Some devices will require advanced configuration in order to toggle orientation properly.

  • For landscape orientation use: {LANDSCAPE_0}, {LANDSCAPE_90}, {LANDSCAPE_180}, {LANDSCAPE_270} to control the orientation and its direction

  • For portrait orientation use: {PORTRAIT_0}, {PORTRAIT_90}, {PORTRAIT_180}, {PORTRAIT_270}

For example:

  • {LANDSCAPE_90} is actually {PORTRAIT_0}

  • {PORTRAIT_180} is actually the device upside down

Code Examples

Java Example
client.sendText("{Landscape}");
C# Example
client.sendText("{Landscape}");
VBScript Example
client.sendText "{Landscape}"
Report
Python Example
self.client.sendText("{Landscape}")
Perl Example
$client->sendText("{Landscape}");